<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>51问医生</title>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <script src="{{url('/js/jquery.min.js')}}" type="text/javascript"></script>

    <!-- Plupload上传类 -->
    <script src="{{ url('vendor/plupload-2.1.2/plupload.full.min.js') }}"></script>
    <script src="{{ url('vendor/plupload-2.1.2/i18n/zh_CN.js') }}"></script>

    <!-- Noty 提示框的js集成 -->
    <script src="{{ url('vendor/noty-2.2.9/packaged/jquery.noty.packaged.js') }}"></script>
    <script src="{{ url('vendor/noty-2.2.9/themes/bootstrap.js') }}"></script>
    <script src="{{ url('vendor/noty-2.2.9/options.js') }}"></script>

    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <style>
        html, body
        {
            padding: 0;
            margin: 0;
            height: 100%;
            overflow:hidden;
        }
        .btn-submit button {
            margin-top: .746666666666667rem;
        }
        .btn-submit button {
            margin: .533333333333333rem 3.733333333333333% .32rem;
            width: 91.46666666666667%;
            font-weight: 400;
        }
        .ax-bareBtn button, .ax-subBtn button {
            width: 67.73333333333333%;
            border-radius: .026666666666667rem;
            background: #fc8f0f;
            border: 0;
            height: 1.173333333333333rem;
            line-height: 1.173333333333333rem;
            text-align: center;
            color: #fff;
            font-size: .426666666666667rem;
            font-weight: bolder;
            display: inline-block;
            outline: 0;
        }

        .content{
            padding-top: 7px;
            padding-left: 20px;
            padding-right: 20px;
        }
        .tips{
            text-align: center;
            font-size: 16px;
            padding: 20px;
        }
        .time-area{
            margin-left: 45%;
        }
        .time-area span{
            font-size: 15px;
            font-weight: bold;
        }
        .time-area .second-time{
            margin-left: 45%;
        }

        .week{
            width: 30%;
            text-align: center;

        }
        .btn{
            padding: 5px;
            width: 70px;
            border: 1px solid #ffffff;
            color: #ffffff;
            background-color: #cac3c3;
        }
        .cur{
            background-color: #fc8f0f;
        }
        .table-bordered td{
            text-align: center;
        }
        .set_value{
            margin-top: 5px;
        }
        .set_value input{
            width: 70%;
            border: 1px solid #76757c;
        }
    </style>

</head>
<body>
<div class="content">
    <div class="tips">
        <span>请选择预约门诊时间</span>
    </div>
    <div class="seting">
        <div class="time-area">
            <span class="first-time">上午</span>
            <span class="second-time">下午</span>
        </div>
        <table class="table table-bordered">
            <tr>
                <td class="week">今天</td>
                <td><button class="btn @if($date_one && $date_one->am == 1)cur @endif" data-id="one"  data-time="am" @if(!$date_one || ($date_one && $date_one->am == 0))disabled @endif>@if($date_one && $date_one->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_one && $date_one->pm == 1)cur @endif" data-id="one" data-time="pm" @if(!$date_one || ($date_one && $date_one->pm == 0))disabled @endif>@if($date_one && $date_one->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_one" value="{{time()}}">
            </tr>
            <tr>
                <td class="week">{{\App\Services\Tools::getWeek(strtotime('+1 days'))}}</td>
                <td><button class="btn @if($date_two && $date_two->am == 1)cur @endif" data-id="two" data-time="am" @if(!$date_two || ($date_two && $date_two->am == 0))disabled @endif>@if($date_two && $date_two->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_two && $date_two->pm == 1)cur @endif" data-id="two" data-time="pm" @if(!$date_two || ($date_two && $date_two->pm == 0))disabled @endif>@if($date_two && $date_two->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_two" value="{{strtotime('+1 days')}}">
            </tr>
            <tr>
                <td class="week">{{\App\Services\Tools::getWeek(strtotime('+2 days'))}}</td>
                <td><button class="btn @if($date_three && $date_three->am == 1)cur @endif" data-id="three" data-time="am" @if(!$date_three || ($date_three && $date_three->am == 0))disabled @endif>@if($date_three && $date_three->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_three && $date_three->pm == 1)cur @endif" data-id="three" data-time="pm" @if(!$date_three || ($date_three && $date_three->pm == 0))disabled @endif>@if($date_three && $date_three->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_three" value="{{strtotime('+2 days')}}">
            </tr>
            <tr>
                <td class="week">{{\App\Services\Tools::getWeek(strtotime('+3 days'))}}</td>
                <td><button class="btn @if($date_four && $date_four->am == 1)cur @endif" data-id="four" data-time="am" @if(!$date_four || ($date_four && $date_four->am == 0))disabled @endif>@if($date_four && $date_four->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_four && $date_four->pm == 1)cur @endif" data-id="four" data-time="pm" @if(!$date_four || ($date_four && $date_four->pm == 0))disabled @endif>@if($date_four && $date_four->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_four" value="{{strtotime('+3 days')}}">
            </tr>
            <tr>
                <td class="week">{{\App\Services\Tools::getWeek(strtotime('+4 days'))}}</td>
                <td><button class="btn @if($date_fire && $date_fire->am == 1)cur @endif" data-id="fire" data-time="am" @if(!$date_fire || ($date_fire && $date_fire->am == 0))disabled @endif>@if($date_fire && $date_fire->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_fire && $date_fire->pm == 1)cur @endif" data-id="fire" data-time="pm" @if(!$date_fire || ($date_fire && $date_fire->pm == 0))disabled @endif>@if($date_fire && $date_fire->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_fire" value="{{strtotime('+4 days')}}">
            </tr>
            <tr>
                <td class="week">{{\App\Services\Tools::getWeek(strtotime('+5 days'))}}</td>
                <td><button class="btn @if($date_six && $date_six->am == 1)cur @endif" data-id="six" data-time="am" @if(!$date_six || ($date_six && $date_six->am == 0))disabled @endif>@if($date_six && $date_six->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_six && $date_six->pm == 1)cur @endif" data-id="six" data-time="pm" @if(!$date_six || ($date_six && $date_six->pm == 0))disabled @endif>@if($date_six && $date_six->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_six" value="{{strtotime('+5 days')}}">
            </tr>
            <tr>
                <td class="week">{{\App\Services\Tools::getWeek(strtotime('+6 days'))}}</td>
                <td><button class="btn @if($date_seven && $date_seven->am == 1)cur @endif" data-id="seven" data-time="am" @if(!$date_seven || ($date_seven && $date_seven->am == 0))disabled @endif>@if($date_seven && $date_seven->am == 1)可预约@else休息 @endif</button></td>
                <td><button class="btn @if($date_seven && $date_seven->pm == 1)cur @endif" data-id="seven" data-time="pm" @if(!$date_seven || ($date_seven && $date_seven->pm == 0))disabled @endif>@if($date_seven && $date_seven->pm == 1)可预约@else休息 @endif</button></td>
                <input type="hidden" id="date_seven" value="{{strtotime('+6 days')}}">
            </tr>
        </table>
    </div>
</div>
<script>
    $(function(){
        $(document).on('click','.btn',function(){
            var dataId   = $(this).attr('data-id');
            var dataTime = $(this).attr('data-time');
            var day      = $('#date_'+dataId).val();
            window.location.href="{{route('M.Home.newAppoint')}}?doc_id={{$doc_id}}&day="+day+"&t="+dataTime;
        });
    });
</script>
</body>
</html>